1. Field of the Invention
This invention is related to the field of microprocessors and, more particularly to instruction execution within microprocessors.
2. Description of the Related Art
Generally, a microprocessor is designed to execute instructions from a predefined instruction set. The instruction set is defined as part of a microprocessor architecture to which the microprocessor is implemented. Additionally, the microprocessor architecture defines other features of the microprocessor such as the memory addressing scheme, address translation modes, operand addressing modes, protection modes, etc. For example, the x86 microprocessor architecture is the microprocessor architecture employed by the line of microprocessors including the 8086, 80286, 80386, 80486, etc.
According to the microprocessor architecture employed by a particular microprocessor, the microprocessor performs a predefined operation in response to each instruction within the instruction set, thereby producing a result. The predefined operation is performed upon one or more input operands specified by the instruction. The input operands may be either implicit to the instruction or explicitly encoded in an instruction field. The predefined operation of a particular instruction within the instruction set is referred to herein as the "architecturally defined operation" for that instruction. The architecturally defined operation is the operation associated with a given opcode encoding by the microprocessor architecture.
Instructions within an instruction set are differentiated from one another via the opcodes assigned to each instruction. Each instruction is assigned at least one opcode encoding, and no opcode encoding is assigned to more than one instruction. Unfortunately, once the instruction format is defined within a given microprocessor architecture, it is difficult to increase the number of opcode encodings. As various microprocessor implementations are developed, it is often desirable to add instructions to the instruction set. The added instructions are assigned opcode encodings from the list of previously unassigned opcodes. Once the list of unassigned opcodes is exhausted, then no more instructions can be easily added to the instruction set.
Further compounding the problem is that some of the instructions within the instruction set are seldom used. For example, certain instructions are defined as privileged. Privileged instructions are typically executed only by the operating system. The operating system is the low-level software within a computer system including the microprocessor. The operating system schedules tasks, allocates storage, handles the interface to peripheral hardware and presents a default interface to the user when no application program is running. Exemplary operation systems include Windows, UNIX, etc. Application programs, which are designed to perform a particular task and use the operating system to access peripheral hardware and perform other low-level services, are typically not accorded a privilege level sufficient to execute the privileged instructions. The opcode encodings assigned to the privileged instructions are effectively wasted while application programs are executing. Still further, other instructions are defined to perform an operation which is seldom used. Operations which are seldom used may be detected, for example, by analyzing the percentage of different instructions executed by different application programs. Those instructions with low utilization (less than, for example, 5% of instructions executed) are the instructions which perform seldom-used operations. If an application program does not execute the seldom-used instruction, the opcode encoding assigned to the seldom-used instruction is effectively wasted as well while that application program is running. However, since other applications use the seldom-used instructions and the operating system uses the privileged instructions, these instructions cannot be discarded to free opcode encodings for assignment to newly added instructions.
In addition to adding new operations to a predefined instruction set, other feature expansions may be desirable as well. For example, adding resources (such as more registers to be used as general operands for instructions) may be difficult given the instruction encodings selected when the microprocessor architecture is defined.